/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Entity;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.OneToOne;
import javax.persistence.Temporal;

/**
 *
 * @author James
 */
@Entity
public class InactivatedUser implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    private String  id;
    private long    registeredDate;
    @OneToOne(cascade={CascadeType.PERSIST})
    private Customer   theUser;
    
    public InactivatedUser() {}
    
    public InactivatedUser(String id, Customer theUser) {
        this.id             = id;
        this.registeredDate = System.currentTimeMillis();
        this.theUser        = theUser;
    }

    //Getters and Setters
    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public long getRegisteredDate() {
        return registeredDate;
    }

    public void setRegisteredDate(long registeredDate) {
        this.registeredDate = registeredDate;
    }

    public Customer getUser() {
        return theUser;
    }

    public void setUser(Customer theUser) {
        this.theUser = theUser;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof InactivatedUser)) {
            return false;
        }
        InactivatedUser other = (InactivatedUser) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "Entity.InactivatedUser[ id=" + id + " ]";
    }
    
}
